package net.ericaro.neojavagen.blocks ;
import net.ericaro.neojavagen.blocks.ForStatement;
import net.ericaro.neojavagen.types.Type;
import net.ericaro.neojavagen.classes.VariableModifiers;
import net.ericaro.neojavagen.blocks.Statement;
import net.ericaro.neojavagen.types.Identifier;
import net.ericaro.neojavagen.expressions.Expression ;

/**
* *<pre> EnhancedForStatement :
    for ( VariableModifiers? Type Identifier : Expression ) Statement
</pre>
*/
public class EnhancedForStatement  implements ForStatement {

VariableModifiers variablemodifiers;
Type type;
Identifier identifier;
Expression expression;
Statement statement ;

public EnhancedForStatement( VariableModifiers variablemodifiers, Type type, Identifier identifier, Expression expression, Statement statement ){
	this.variablemodifiers = variablemodifiers; this.type = type; this.identifier = identifier; this.expression = expression; this.statement = statement ;
	}public EnhancedForStatement( Type type, Identifier identifier, Expression expression, Statement statement ){
this.type = type; this.identifier = identifier; this.expression = expression; this.statement = statement ;
}


public String toString(){
	StringBuilder stringbuilder = new StringBuilder();
	stringbuilder.append( "for" ).append(" ");
stringbuilder.append( "(" ).append(" ");
if (this.variablemodifiers !=null ) stringbuilder.append( this.variablemodifiers ).append(" ");
stringbuilder.append( this.type ).append(" ");
stringbuilder.append( this.identifier ).append(" ");
stringbuilder.append( ":" ).append(" ");
stringbuilder.append( this.expression ).append(" ");
stringbuilder.append( ")" ).append(" ");
stringbuilder.append( this.statement ).append(" ") ;
	return stringbuilder.toString();
}

}
